﻿using System;
using System.Collections.Generic;

namespace EvoBoost.Core
{
	static class IListExtensions
	{
		private static readonly Random random = new Random();
		
		public static void Shuffle<T>(this IList<T> list)
		{
			for (int i = 0; i < list.Count * 2; ++i)
			{
				int index1 = random.Next(list.Count);
				int index2 = random.Next(list.Count);
				T temp = list[index1];
				list[index1] = list[index2];
				list[index2] = temp;
			}
		}
	}
}
